Skip to content

Add unit tests for display utilities and git operations#46

Merged
that-github-user merged 1 commit into
mainfrom
issue-23-add-tests
Mar 28, 2026
Merged

Add unit tests for display utilities and git operations#46
that-github-user merged 1 commit into
mainfrom
issue-23-add-tests

Conversation

@that-github-user

Copy link
Copy Markdown
Owner

Summary

  • 9 tests for padRight (ANSI code handling, edge cases) and formatDuration (seconds, minutes, rounding)
  • 6 tests for git lifecycle: getRepoRoot, createWorktree, getDiff, getDiffStats, removeWorktree, cleanupBranches
  • Export padRight and formatDuration for direct testability
  • Test suite grows from 41 → 56 tests

Change type

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • CI / infrastructure
  • Chore

Related issue

Closes #23

How to test

npm test  # 56 tests pass

Breaking changes

  • This PR introduces breaking changes

🤖 Generated with Claude Code

- 9 tests for padRight (ANSI handling, edge cases) and formatDuration
- 6 tests for git lifecycle: getRepoRoot, createWorktree, getDiff,
  getDiffStats, removeWorktree, cleanupBranches
- Export padRight and formatDuration for testability
- Total: 56 tests passing (up from 41)

Closes #23

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@that-github-user

Copy link
Copy Markdown
Owner Author

Self-review: Git tests create and clean up a real worktree (integration test). Display tests verify ANSI stripping math. All 56 tests pass, lint clean.

@that-github-user that-github-user merged commit 2419a20 into main Mar 28, 2026
@that-github-user that-github-user deleted the issue-23-add-tests branch March 28, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for git utils, display, and CLI commands

1 participant